# -*- coding: UTF-8 -*-
import socket               # 导入 socket 模块
s = socket.socket()         # 创建 socket 对象
host = "49.123.67.123"          # 获取本地主机名
port = 8787                 # 设置端口
s.bind((host, port))        # 绑定端口
s.listen(5)                 # 等待客户端连接
print("waiting for accept ...")
c, addr = s.accept()        # 建立客户端连接
print("client accept ...")
while True:
    str = c.recv(100)
    print(str)
    if len(str) == 0:
        break
c.close()                   # 关闭连接